package com.leoman.plz_p.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.leoman.plz_p.R;
import com.leoman.plz_p.module.bean.CategoryBean;

import cn.com.corelib.utils.adapter.BaseAdapterHelper;
import cn.com.corelib.utils.adapter.normal.QuickAdapter;

/**
 * Created by guoh on 2018/8/26.
 */
public class HomeClassifyAdapter extends QuickAdapter<CategoryBean>{
    public HomeClassifyAdapter(Context context) {
        super(context, R.layout.item_home_classify);
    }

    @Override
    protected void convert(BaseAdapterHelper helper, CategoryBean item, int position) {
        if (!TextUtils.isEmpty(item.getImage()))
        Glide.with(context).load(item.getImage()).into((ImageView) helper.getView(R.id.iv_image));
        helper.setText(R.id.tv_text,item.getName());
    }
}
